<template>
	<view class="service_box" :style="{ paddingTop: navHeight + 'px' }">
		<view class="service">
			<image
				@click="goUrl(`/subPages/service/cemetery?qrcodeUrl=${qrcodeUrl}`)"
				src="http://112.124.50.179:8888/imgs/service/service2.png"
				mode="widthFix"
			></image>
			<image
				@click="goUrl(`/subPages/service/worshipService?qrcodeUrl=${qrcodeUrl}`)"
				src="http://112.124.50.179:8888/imgs/service/service1.png"
				mode="widthFix"
			></image>
		</view>
	</view>

	<!-- 客服 -->
	<customerService :qrcodeUrl="qrcodeUrl"></customerService>
</template>

<script setup>
import { reactive,ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import myButton from '/components/button/index.vue';
import customerService from '/components/customerService/index.vue';
import CommonApi from '../../API/commenApi';

const navHeight = getApp().globalData.navHeight; //考虑微信胶囊
const commonApi = new CommonApi()
const qrcodeUrl = ref()

const goUrl = (url) => {
	uni.navigateTo({
		url: url
	});
};

onLoad(() => {
	getCustomerUrl()
});

/**
 * 获取客服二维码
 */
const getCustomerUrl = async()=>{
	let res = await commonApi.getCustomerUrl({from:3})
	if(res.code === 0){
		qrcodeUrl.value = res.data.url
	}
}
</script>

<style lang="scss">
page {
	background-color: #121512;
	padding-top: 0;
}

.service_box {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	overflow: scroll;
}

.service {
	padding: 0 32rpx;
	/* #ifdef H5 */
	padding-top: 32rpx;
	/* #endif */
	image {
		width: 100%;
		margin-bottom: 32rpx;
	}
}
</style>
